import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/Layout/Layout.vue'

const routes = [
  {
    path: '/',
    name: 'layout',
    component: Layout,
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('@views/HomeView/HomeView.vue')
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('@views/AboutView/AboutView.vue')
      },
      {
        path: '/test-i18n',
        name: 'test-i18n',
        component: () => import('@views/TestI18nView/TestI18nView.vue')
      },
      {
        path: '/theme-colors',
        name: 'theme-colors',
        component: () => import('@views/ThemeColorsView/ThemeColorsView.vue')
      },
      {
        path: '/api-demo',
        name: 'api-demo',
        component: () => import('../components/ApiDemo.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes
})

export default router
